import Vue from 'vue'
import VueRouter from 'vue-router'
import Reg from '@/views/Reg/Reg.vue'
import Login from '@/views/Login/Login.vue'
import Main from '../views/Main/Main.vue'
import Home from '@/views/Menus/Home/Home.vue'
import UserInfo from '@/views/Menus/User/UserInfo.vue'
import UserAvatar from '@/views/Menus/User/UserAvatar.vue'
import UserPwd from '@/views/Menus/User/UserPwd.vue'
import ArtCate from '@/views/Menus/Article/ArtCate.vue'
import ArtList from '@/views/Menus/Article/ArtList.vue'

Vue.use(VueRouter)

const routes = [
  {
    name: 'Reg',
    path: '/reg',
    component: Reg
  },
  {
    name: 'Login',
    path: '/login',
    component: Login
  },
  {
    name: 'Main',
    path: '/',
    component: Main,
    redirect: '/home',
    children: [
      {
        name: 'Home',
        path: '/home',
        component: Home
      },
      {
        name: 'UserInfo',
        path: '/user-info',
        component: UserInfo
      },
      {
        name: 'UserAvatar',
        path: '/user-avatar',
        component: UserAvatar
      },
      {
        name: 'UserPwd',
        path: '/user-pwd',
        component: UserPwd
      },
      {
        name: 'ArtCate',
        path: '/art-cate',
        component: ArtCate
      },
      {
        name: 'ArtList',
        path: '/art-list',
        component: ArtList
      }
    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
